﻿namespace EnergyGeneratorSim.Parameters
{
    using System;

    /// <summary>
    /// Simulation parameters: simulation duration and granularity
    /// coil dimensions
    /// </summary>
    public class SimulationParameters
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SimulationParameters"/> class.
        /// </summary>
        public SimulationParameters()
        {
            this.Inductor = new InductorParameters();
            this.PermanentMagnet = new PermanentMagnetParameters();
            this.General = new GeneralParameters();
        }

        /// <summary>
        /// Gets or sets the anz P.
        /// Zum Lösen der Dgl.: Anzahl der tatsächlich berechneten Zeit-Schritte
        /// </summary>
        /// <value>The anz P.</value>
        public ulong AnzP { get; set; }

        /// <summary>
        /// Gets or sets the dt.
        /// Sekunden} {Zum Lösen der Dgl.: Dauer der Zeitschritte zur iterativen Lsg. der Dgl.
        /// </summary>
        /// <value>The dt.</value>
        public double dt { get; set; }

        /// <summary>
        /// Gets or sets the abstd.
        /// Nur für die Vorbereitung, nicht zum Lösen der Dgl.: Jeden wievielten Punkt soll ich plotten ins Excel
        /// </summary>
        /// <value>The abstd.</value>
        public ulong Abstd { get; set; }

        /// <summary>
        /// Gets or sets the plot anfang.
        /// Zum Lösen der Dgl.: Erster-Plot-Punkt: Anfang des Daten-Exports nach Excel
        /// </summary>
        /// <value>The plot anfang.</value>
        public ulong PlotAnfang { get; set; }

        /// <summary>
        /// Gets or sets the plot ende.
        /// Zum Lösen der Dgl.: Letzter-Plot-Punkt: Ende des Daten-Exports nach Excel
        /// </summary>
        /// <value>The plot ende.</value>
        public ulong PlotEnde { get; set; }

        /// <summary>
        /// Gets or sets the plot step.
        /// Zum Lösen der Dgl.: Schrittweite des Daten-Exports nach Excel
        /// </summary>
        /// <value>The plot step.</value>
        public ulong PlotStep { get; set; }

        /// <summary>
        /// Gets or sets the inductor parameters of the R-C oscilator.
        /// </summary>
        /// <value>The inductor.</value>
        public InductorParameters Inductor { get; private set; }

        /// <summary>
        /// Gets or sets the permanent magnet parameters of the rotating magnet that is within the
        /// inductor coil.
        /// </summary>
        /// <value>The permanent magnet.</value>
        public PermanentMagnetParameters PermanentMagnet { get; private set; }

        /// <summary>
        /// Gets or sets the general parameters.
        /// </summary>
        /// <value>The general parameters.</value>
        public GeneralParameters General { get; private set; }

        public SimulationParameters Clone()
        {
            var parameters = (SimulationParameters)this.MemberwiseClone();
            parameters.PermanentMagnet = this.PermanentMagnet.Clone();
            parameters.Inductor = this.Inductor.Clone();
            parameters.General = this.General.Clone();

            return parameters;
        }
    }
}
